package com.iha.ponggame;

import java.util.Random;

public class Pad {
	static final Random rand = new Random();
	public float x, y;
	public float dirX;

	public Pad(boolean top) {
		if(top)
			y = 460;
		else
			y = 20;
		
		x = 160;
		dirX = 0;
	}
	
	public void update(float deltaTime) {
		x = x + dirX * deltaTime;
		
		if (x < 0) {
			dirX = -dirX;
			x = 0;
		}

		if (x > 320) {
			dirX = -dirX;
			x = 320;
		}
	}
}

